Digital cameras are one of examples of signal processing apparatuses which record/play back an image signal as a digital signal conventionally use a memory card as a recording medium of image data and the like. Representative examples of the memory card are a PC card and a CompactFlash (registered trademark). Data are written on or read out from these cards by using commands defined by ATA standard.
Of these memory cards, the control method of CompactFlash (registered trademark) is disclosed in Cf+ and CompactFlash Specification Revision 1.4 issued by CompactFlash Association. The control method of the PC card is disclosed in PC Card Standard Release 7 issued by PCMCIA/JEIDA.
For, e.g., a data write, the host issues a write sector command to the memory card. Processing waits until the card is set in the data writable state. That the card is set in the data writable state can be detected by using an interrupt request signal (IREQ signal) output from the card and the status register of the card. Upon detecting the assert of the IREQ signal, the host reads the status register of the card and confirms that the ready flag indicates the ready state, the data request flag indicates the data request state, and the error flag indicates no error state. When these states are confirmed, the host can write data of 1 sector on the card.
Even when the host should continuously write data of a plurality of sectors on the card, the card status must be confirmed for each sector.
Similarly, in reading out data from the memory card, the host issues a sector read command and confirms the IREQ signal and status register value. After that, the host can read out data of 1 sector.
Japanese Patent Laid-Open No. 6-337840 (corresponding to U.S. Pat. No. 5,450,551) discloses an example of a system which has an interface to such a memory card. In this system data transfer to the memory card is controlled by a DMA controller.
This means that DMA (Direct Memory Access) can be used for data transfer to/from a memory card.
On the other hand, a memory card such as CompactFlash (registered trademark) or PCMCIA I/O card using ATA standard requires check of the card status every time data having a predetermined size (e.g., 1 sector) is transferred.
When data transfer to/from a memory card is done by using DMA, the data transfer unit by DMA is set to 1 sector. The host must repeatedly execute status read, check, and DMA activation every time 1 sector is transferred.
The memory card can output an interrupt request signal (IREQ signal) for each data transfer unit. When this signal is connected to the interrupt request input of the CPU, it can execute status check for each sector.
When the IREQ signal is asserted, the CPU suspends the task that has been executed so far and saves the values of the register and stack related to the task in a memory. The CPU starts interrupt processing and executes the status read and check of the status value. The CPU confirms by comparison with expected values that the ready flag of the status register indicates the ready state, the data request flag indicates the data request state, and the error flag indicates no error state.
When the status values coincide with the expected values, the CPU activates the DMA controller and ends the interrupt processing. Accordingly, data of 1 sector can be DMA-transferred from the system memory to the memory card or from the memory card to the system memory.
Until the end of desired data transfer, the CPU repeatedly executes this processing, thereby achieving data transfer.
As described above, conventionally, the DMA is operated for each sector. In addition, the value of the status register of the card must be confirmed for each sector.
To do this, the CPU must execute interrupt processing for each sector.
Normally, the CPU executes not only processing for the memory card but also power supply control, serial communication, or image sensing control for a digital camera by processing various interrupt requests asserted by the device. The CPU also saves the stack and register.
Hence, the CPU does not always start reading the card status immediately after the card asserts the IREQ signal, and a time of several hundred ms may be consumed.
Accordingly, the time of several hundred ms is wasted after the memory card asserts the IREQ signal until the DMA controller starts data transfer to the memory card. As described above, the IREQ signal is asserted every time 1 sector is processed. As a result, the time required for transfer of all desired data between the host and the card increases.
This problem is serious especially in a digital camera.
A digital camera generates an image file upon photography and records it in a memory card. If the recording time in the memory card prolongs, the user must wait after a shot until the camera is ready for the next shot and may lose a shutter chance.
In addition, the CPU activates interrupt processing every time 1 sector is transferred. Since another ongoing progressing task is stopped every time, the execution speed of the task decreases.
As a result, in, e.g., a digital camera, the response of the user interface delays, or the moving image sensing capability degrades. Accordingly, automatic exposure or automatic white balance processing in a moving image cannot be achieved, resulting in a degradation in image quality.
In a digital camera, normally, an image sensing element reads a horizontal line in synchronism with a predetermined period and repeatedly reads horizontal lines in the vertical direction, thereby obtaining an image signal. At this time, the brightness or white balance of the image must appropriately be controlled. The digital camera analyzes the generated image data of one frame and sets the analysis result as parameters in the image sensing circuit. With this processing, the brightness or white balance of the image is appropriately controlled.
Thus, the image data analysis and parameter setting in the image sensing circuit must be completed within a time between frames, which is generally called the vertical blanking period.
If data is transferred to a memory card, the system bus is occupied during the data transfer, and control of the image brightness or white balance cannot be ended till the next frame in some cases. This also leads to a degradation in image quality.